package com.smart.five.ioc.java.configuration.bean;

import com.smart.five.ioc.java.configuration.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Scope;

/*
    由于Spring会自动对@Configuration的类进行改造，以植入Spring对Bean的管理逻辑，
    所以使用基于java类的配置必须保证将Spring aop类包和CGLIB类包加载到类路径下
 */
@Configuration
@Import(Appconf.class)
public class ServiceConfig2 {

    @Bean
    public LoginService loginService(){
        LoginService loginService = new LoginService();
        return loginService;
    }
}
